import asyncio
import ygg_aiomysql as aiomysql

async def main():
    """
    示例09: 获取连接池配置信息
    """
    # 创建连接池
    pool = await aiomysql.new_pool(
        host='localhost',
        port=3306,
        user='root',
        password='zhangdapeng520',
        db='test'
    )
    
    # 获取配置信息
    config = await aiomysql.get_pool_config(pool)
    
    # 打印配置信息
    print("连接池配置信息:")
    print(f"主机: {config['host']}")
    print(f"端口: {config['port']}")
    print(f"用户名: {config['user']}")
    print(f"密码: {config['password']}")
    print(f"数据库: {config['db']}")
    
    # 关闭连接池
    pool.close()
    await pool.wait_closed()

if __name__ == "__main__":
    asyncio.run(main())